<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>游戏排行</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="stylesheet" href="../../static/css/me.css">
</head>
<body>

<!--导航-->
<nav th:replace="_fragments :: menu(4)" class="ui inverted attached segment m-padded-tb-mini m-shadow-small" ></nav>

<div class="ui attached pointing menu">
    <div class="ui container">
        <div class="left menu">
            <a href="#" th:href="@{/rank}" class="item" th:classappend="${activeMode==1 ? 'teal active':''}">分类我在行</a>
            <a href="#" th:href="@{/rank/mode2}" class="item" th:classappend="${activeMode==2 ? 'teal active':''}">投放最精准</a>
            <a href="#" th:href="@{/rank/mode3}" class="item" th:classappend="${activeMode==3 ? 'teal active':''}">知识我最棒</a>
        </div>
    </div>
</div>

<!--中间内容-->
<div  class="m-container-small m-padded-tb-big">
    <div class="ui container">
        <table class="ui compact teal table">
            <thead>
            <tr>
                <th>排名</th>
                <th>昵称</th>
                <th>分数</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="user,iterStat : ${page.content}">
                <td th:text="${page.number*10+iterStat.count}">1</td>
                <td th:text="${user.nickname}">刻意练习清单</td>
                <td th:if="${activeMode==1}" th:text="${user.mode1}">刻意练习清单</td>
                <td th:if="${activeMode==2}" th:text="${user.mode2}">刻意练习清单</td>
                <td th:if="${activeMode==3}" th:text="${user.mode3}">刻意练习清单</td>
            </tr>
            </tbody>
            <tfoot>
            <tr>
                <th colspan="6" >
                    <div class="ui mini pagination menu" th:if="${page.totalPages}>1">
                        <div th:if="${activeMode==1}">
                            <a th:href="@{/rank(page=${page.number}-1)}" class=" item" th:unless="${page.first}">上一页</a>
                            <a th:href="@{/rank(page=${page.number}+1)}" class=" item" th:unless="${page.last}">下一页</a>
                        </div>
                        <div th:if="${activeMode==2}">
                            <a th:href="@{/rank/mode2(page=${page.number}-1)}" class=" item" th:unless="${page.first}">上一页</a>
                            <a th:href="@{/rank/mode2(page=${page.number}+1)}" class=" item" th:unless="${page.last}">下一页</a>
                        </div>
                        <div th:if="${activeMode==3}">
                            <a th:href="@{/rank/mode3(page=${page.number}-1)}" class=" item" th:unless="${page.first}">上一页</a>
                            <a th:href="@{/rank/mode3(page=${page.number}+1)}" class=" item" th:unless="${page.last}">下一页</a>
                        </div>
                    </div>
                </th>
            </tr>
            </tfoot>
        </table>
    </div>
</div>

<br>
<br>
<!--底部footer-->
<footer th:replace="_fragments :: footer" class="ui inverted vertical segment m-padded-tb-massive"></footer>

<!--/*/<th:block th:replace="_fragments :: script">/*/-->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
<!--/*/</th:block>/*/-->

<script>
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });

    $('.ui.dropdown').dropdown({
        on : 'hover'
    });

</script>
</body>
</html>